<!DOCTYPE html>
<html lang="en">
<head>
    <!-- page specific plugin styles -->
    <link rel="stylesheet" href="http://ams.admin.haiziwang.com:8086/css/jquery-ui-1.10.3.custom.min.css" />
    <link rel="stylesheet" type="text/css" href="http://ams.admin.haiziwang.com:8086/uploadify/uploadify.css">
    <link rel="stylesheet" href="http://ams.admin.haiziwang.com:8086/css/datepicker.css" />
    <link rel="stylesheet" href="http://ams.admin.haiziwang.com:8086/css/bootstrap-timepicker.css" />
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css">
    <style>
        li {list-style-type:none;}
        .uploadify-queue{ display: none;} 
        .title_top{ border:1px solid #000;padding: 0 0 51px; margin: 0 0 20px;}  
    </style>
</head>
<body>
<form action="request.php" method="post" name="registForm"> 
    <div class="col-lg-12 title_top">
        <h1><span class ="title">第一块</span></h1>
        <div class="col-lg-12">
            请输入id
        </div>
    </div>
    <div class="col-lg-12 title_top">
        <h1><span class ="title">第二块</span></h1>
        <div class="col-lg-1">
            <input id="file_upload0" name="file_upload0" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture0"></ul>
            <input type="hidden" name="form_art_picture0" id="form_art_picture0" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload1" name="file_upload1" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture1"></ul>
            <input type="hidden" name="form_art_picture1" id="form_art_picture1" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload2" name="file_upload2" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture2"></ul>
            <input type="hidden" name="form_art_picture2" id="form_art_picture2" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload3" name="file_upload3" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture3"></ul>
            <input type="hidden" name="form_art_picture3" id="form_art_picture3" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload4" name="file_upload4" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture4"></ul>
            <input type="hidden" name="form_art_picture4" id="form_art_picture4" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload5" name="file_upload5" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture5"></ul>
            <input type="hidden" name="form_art_picture5" id="form_art_picture5" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload6" name="file_upload6" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture6"></ul>
            <input type="hidden" name="form_art_picture6" id="form_art_picture6" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload7" name="file_upload7" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture7"></ul>
            <input type="hidden" name="form_art_picture7" id="form_art_picture7" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload8" name="file_upload8" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture8"></ul>
            <input type="hidden" name="form_art_picture8" id="form_art_picture8" value=""/>
        </div>
        <div class="col-lg-1">
            <input id="file_upload9" name="file_upload9" type="file" multiple="false"><ul style="padding-left: 0px;" id="art_picture9"></ul>
            <input type="hidden" name="form_art_picture9" id="form_art_picture9" value=""/>
        </div>
    </div>
    <div class="col-lg-12 title_top">
        <h1><span class ="title">第三块</span></h1>
        <div class="col-lg-3">

        </div>
        <div class="col-lg-3">

        </div>
        <div class="col-lg-3">

        </div>
        <div class="col-lg-3">

        </div>
    </div>
    <input type="submit" value="提交" name="submit"/> 
</form> 




<script type="text/javascript">
    window.jQuery || document.write("<script src='http://ams.admin.haiziwang.com:8086/js/jquery-2.0.3.min.js'>"+"<"+"script>");
</script>

<!-- <![endif]-->



<script type="text/javascript">
    if("ontouchend" in document) document.write("<script src='http://ams.admin.haiziwang.com:8086/js/jquery.mobile.custom.min.js'>"+"<"+"script>");
</script>


<!-- ace scripts -->


<!-- page specific plugin scripts -->


<script src="http://ams.admin.haiziwang.com:8086/uploadify/jquery.uploadify.min.js?v=<?php echo microtime(true);?>" type="text/javascript"></script>


<!-- inline scripts related to this page -->

<script type="text/javascript">
    var imageUploadUrl = 'http://ims.haiziwang.com/pic/file/upload.do?bucket=amspic';
    $('#file_upload0').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],
        
        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture0').prepend(new_img);
                $('#form_art_picture0').val(info.content.downloadUrl);
            }, 'json');
        }
    });
    $('#file_upload1').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture1').prepend(new_img);
                $('#form_art_picture1').val(info.content.downloadUrl);
            }, 'json');
        }
    });
    $('#file_upload2').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture2').prepend(new_img);
                $('#form_art_picture2').val(info.content.downloadUrl);
            }, 'json');
        }
    });
    $('#file_upload3').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture3').prepend(new_img);
                $('#form_art_picture3').val(info.content.downloadUrl);
            }, 'json');
        }
    });
        $('#file_upload4').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture4').prepend(new_img);
                $('#form_art_picture4').val(info.content.downloadUrl);
            }, 'json');
        }
    });
    $('#file_upload5').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture5').prepend(new_img);
                $('#form_art_picture5').val(info.content.downloadUrl);
            }, 'json');
        }
    });
    $('#file_upload6').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture6').prepend(new_img);
                $('#form_art_picture6').val(info.content.downloadUrl);
            }, 'json');
        }
    });
        $('#file_upload7').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture7').prepend(new_img);
                $('#form_art_picture7').val(info.content.downloadUrl);
            }, 'json');
        }
    });
        $('#file_upload8').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture8').prepend(new_img);
                $('#form_art_picture8').val(info.content.downloadUrl);
            }, 'json');
        }
    });
        $('#file_upload9').uploadify({
        'width': 109,
        'height': 30,
        'buttonText': '图片上传',
        'swf': '/uploadify/uploadify.swf',
        'uploader': imageUploadUrl,
        'fileObjName': 'files',
        'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
        'fileSizeLimit': '2MB',
        'overrideEvents': ['onUploadError', 'onSelectError', 'onDialogClose'],

        'onSelectError': function (file, errorCode, errorMsg) {
            if (errorCode == -110) {
                alert('单张图片请勿超过2MB');
            } else {
                alert(this.queueData.errorMsg);
            }
        },
        'onUploadSuccess': function (file, data) {
            var info = JSON.parse(data);
            if (!info.success) {
                alert('图片上传失败，请重试');
                return;
            }
            $.post('/picture/addpic', {'path': info.content.downloadUrl}, function (e) {

                if (e.code != 0) {
                    alert(e.msg);
                    return;
                }
                var new_img = '<li>'
                    + '<img data_url="' + info.content.downloadUrl + '" src="' + info.content.downloadUrl + '?imageView2/1/w/50/h/50" alt=""/> '
                    + '<input type="button" class="art_pic_del btn btn-danger btn-sm" data_id="' + e.data.id + '" value="删除"/>'
                    + '</li>'

                $('#art_picture9').prepend(new_img);
                $('#form_art_picture9').val(info.content.downloadUrl);
            }, 'json');
        }
    });
    //图片删除
    $('#art_picture0').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture0').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture1').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture1').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture2').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture2').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture3').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture3').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture4').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture4').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture5').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture5').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture6').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture6').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture7').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture7').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture8').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture8').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
    $('#art_picture9').on('click', '.art_pic_del', function () {
        var $this = $(this),
            id = $this.attr('data_id'),
            parent = $this.parent();
        if (confirm('确认删除该图片吗？')) {
            $('#form_art_picture9').val('');
            $.post('/picture/delPic', {'id': id}, function (data) {
                if (data.code == 0) {
                    parent.remove();
                } else {
                    alert('删除失败');
                }
            }, 'json');
        }
    });
</script>
</body>
</html>

